package com.woniu.mapper.healthSystem;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.model.healthSystem.dto.EmployeeDto;
import com.woniu.model.healthSystem.entity.Manager;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 账号表 Mapper 接口
 * </p>
 *
 * @author gb
 * @since 2023-10-19
 */
public interface ManagerMapperGb extends BaseMapper<Manager> {

    /**
     * 多条件查询
     */
    List<EmployeeDto> findAll(Map<String,Object> condition);

    /**
     * 添加
     */
    @Insert("INSERT INTO h_manager VALUES (null,#{accountName},#{name},#{telphone},#{department},#{createTime},#{password},#{nickName},#{accountId})")
    int addManager(Manager manager);

    /**
     * 编辑
     */
    int update(Manager manager);


    /**
     * 删除
     */
    @Delete("DELETE FROM h_manager WHERE id=#{id}")
    int deleteById(Long id);

    /**
     * 通过accountId查询账号
     */
    List<Manager> findByAccountId(Long accountId);

}
